/*
 * cle.c

 *
 *  Created on: 10 avr. 2013
 *      Author: xavier
 */


#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stddef.h>
#include "SDL.h"
#include "SDL_image.h"

#include "../include/game.h"
#include "../include/misc.h"
#include "../include/cle.h"
#include "../include/liste.h"
#include "../include/map.h"

struct s_key {

	int x, y;
	SDL_Surface * directed_img[1];
	enum k_way key_way;
};

t_key key_init(int x,int y) {
	t_key key = malloc(sizeof(*key));
	key->directed_img[STATE] = load_image("sprite/key.png") ;
	key->x=x;
	key->y=y;
	return key;
}

void key_display(t_key key, SDL_Surface *screen) {


	assert(key);

	assert(key->directed_img[STATE]);
	assert(screen);

	SDL_Rect place;
	place.x = key->x * SIZE_BLOC;
	place.y = key->y * SIZE_BLOC;

	SDL_BlitSurface(key->directed_img[STATE], NULL, screen,
			&place);

}

int key_get_x(t_key key)
{
	return key->x;
}

int key_get_y(t_key key)
{
	return key->y;
}

//MODULE PORTE; POUR PASSER D'UNE PORTE FERMEE A UNE PORTE OUVERTE QUAND ON RAMASSE LA CLE










